import { _decorator, Component, Sprite } from 'cc';
const { ccclass } = _decorator;

import { patternConfigs } from './pattern-config';
import { generatePixelData, createSpriteFrameFromPixelData } from './imageGenerator';

@ccclass('test')
export class test extends Component {



    start(): void {
        // const patternType = 'HEART';
        // const enableColorVariation = true;
        // const variationIntensity: 'subtle' | 'medium' | 'strong' = 'strong';
        // const config = patternConfigs[patternType];
        // if (!config) {
        //     console.error(`未找到图案类型: ${patternType}`);
        //     return;
        // }
        // const { pixelData, width, height } = generatePixelData(config, enableColorVariation, variationIntensity);
        // const {spriteFrame,texture} = createSpriteFrameFromPixelData(pixelData, width, height);
        // const targetNode = this.node.getChildByName('Node');
        // const sprite = targetNode?.getComponent(Sprite);
        // if (!sprite) {
        //     console.error('未找到Sprite组件');
        //     return;
        // }
        // sprite.spriteFrame = spriteFrame;
    }
    update(deltaTime: number) {

    }
}

